
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
    <h3 align="center" > <a href="{% url 'add' %}">添加图书</a> </h3>
	<form align="center" method="post" action="{% url 'search' %}">
		<input type="text" name="name">
		<input type="submit" value="搜索">
	</form>
	<table align="center" border="1" width="300px">
		<tr>
			<td>编号</td>
			<td>标题</td>
			<td>作者</td>
			<td>操作</td>
		</tr>
        {% for i in current_page %}
        <tr>
			<td>{{ i.id }}</td>
			<td>{{ i.title }}</td>
			<td>{{ i.author }}</td>
			<td> <a href="{% url 'delete' i.id  %}">删除</a> </td>
		</tr>
        {% endfor %}
		<tr>
			<td colspan="4" align="center">
                {% if pre_page > 0%}
                 <a href="{% url 'index' %}?page={{ pre_page }}">上一页</a>
                {% endif %}
                第{{ current_num }}页
                {% if current_num < num %}
                   <a href="{% url 'index' %}?page={{ next_page }}">下一页</a>
                {% endif %}
			</td>
		</tr>
	</table>


</body>
</html>